home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "Module1"
- Option Explicit
- Declare Function EnumChildWindows Lib "user32" _
- (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, _
- ByVal lParam As Long) As Boolean
- Declare Function GetWindowText Lib "user32" _
- Alias "GetWindowTextA" _
- (ByVal hwnd As Long, ByVal lpString As String, _
- ByVal cch As Long) As Long
-
- Public Function EnumFunc(ByVal hWndChild As Long, _
- ByVal lParam As Long) As Boolean
- Dim size As Long
- Dim s As String
- s = String(255, 0)
- size = GetWindowText(hWndChild, s, Len(s))
- s = Left$(s, size)
- Form1.List1.AddItem s ' Add caption to Listbox
- EnumFunc = True ' Return FALSE to halt enumeration
- End Function
-
-